package com.ithuaxin.array;

public class Test9 {
    public static void main(String[] args) {
        int arr[] = {1,2,3,4,5};
        int temp;
        for (int i = 0,j = arr.length-1;i<j;i++,j--) {
                temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
        }
        for (int k = 0; k < arr.length; k++) {
            System.out.println(arr[k]);
        }

    }
}
